//NoNameObj.java
package com.ylaihui.oop1;

public class NoNameObj {
	public static void main(String[] args) {
		
		// 每次 new 都会产生一个新的对象
		new Phone().sendMessage();
		new Phone().playGame();
		
		new Phone().setPrice(11.11);
		System.out.println(new Phone().getPrice());	
		
		// 实际开发中经常见到如下用法
		PhoneMall pm = new PhoneMall();
		pm.show(new Phone());
	}
}

class PhoneMall{
	public void show(Phone p){
		p.sendMessage();
	}
}

class Phone{
	double price;
	
	public void playGame(){
		System.out.println("PlayGames!");
	}
	public void sendMessage(){
		System.out.println("send message!");
	}
	public void setPrice(double price){
		this.price = price;
	}
	public double getPrice(){
		return price;
	}
}